// Maybe 函子
class Maybe {
    static of(v) {
        return new Maybe(v)
    }
    constructor(v) {
        this._value = v;
    }
    map(fn) {
        return this.isNothing() ? Maybe.of(this._value) : Maybe.of(fn(this._value));
    }
    isNothing() {
        return this._value === null || this._value === undefined
    }
}
class Container {
    static of(v) {
        return new Container(v)
    }
    constructor(v) {
        this._value = v;
    }
    map(fn){
        return Container.of(fn(this._value));
    }
}





module.exports = { Maybe, Container }